<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.js"></script>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(item,index) in books" :key="item.id">
                {{index+1}}
                {{item.name}}
                {{item.writer}}
            </li>
        </ul>
    </div>
    <script>
        new Vue({
            el: '#app',
            data: {
                books: [
                    { id: 1, name: '水浒传', writer: '施耐庵' },
                    { id: 2, name: '西游记', writer: '吴承恩' },
                    { id: 3, name: '三国演义', writer: '罗贯中' },
                    { id: 4, name: '红楼梦', writer: '曹雪芹' },
                ]
            }
        })
    </script>
</body>

</html>